//
//  TKL_TopCell.m
//  TKL_EnPro
//
//  Created by 雅恩三河科技 on 2018/12/13.
//  Copyright © 2018年 MrZhang. All rights reserved.
//

#import "TKL_TopCell.h"

@interface TKL_TopCell ()
@property(nonatomic,strong)UIImageView* leftIV;
@property(nonatomic,strong)UILabel* titleLab;
@property(nonatomic,strong)UILabel* phoneLab;
@end

@implementation TKL_TopCell
#pragma mark - getter and setter
-(UIImageView *)leftIV
{
    if (!_leftIV) {
        _leftIV=[UIImageView new];
        _leftIV.x=(SCREEN_WIDTH-WFCGFloatY(80))/2;
        _leftIV.y=WFCGFloatY(30+15);
        _leftIV.width=WFCGFloatY(80);
        _leftIV.height=WFCGFloatY(80);
        _leftIV.backgroundColor=[UIColor whiteColor];
        [WFFunctions WFUIaddbordertoView:_leftIV radius:WFCGFloatY(40) width:0 color:[UIColor whiteColor]];
        
    }
    return _leftIV;
}
-(UILabel *)titleLab
{
    if (!_titleLab) {
        _titleLab=[UILabel new];
        _titleLab.x=WFCGFloatX(0);
        _titleLab.y=WFCGFloatY(120+15);
        _titleLab.width=SCREEN_WIDTH;
        _titleLab.height=WFCGFloatY(15);
        _titleLab.font=SYSTEMFONT(15);
        _titleLab.textColor=[UIColor whiteColor];
        _titleLab.textAlignment=NSTextAlignmentCenter;
        _titleLab.text=@"点击登录";
        
    }
    return _titleLab;
}
-(UILabel *)phoneLab
{
    if (!_phoneLab) {
        _phoneLab=[UILabel new];
        _phoneLab.x=0;
        _phoneLab.y=WFCGFloatY(140+15);
        _phoneLab.width=SCREEN_WIDTH;
        _phoneLab.height=WFCGFloatY(14);
        _phoneLab.font=SYSTEMFONT(13);
        _phoneLab.textColor=[UIColor whiteColor];
        _phoneLab.textAlignment=NSTextAlignmentCenter;
    }
    return _phoneLab;
}
#pragma mark - event
#pragma mark - method
#pragma mark - life
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.contentView.backgroundColor = Main_Color;
        [self.contentView addSubview:self.leftIV];
        [self.contentView addSubview:self.titleLab];
        [self.contentView addSubview:self.phoneLab];
        
    }
    return self;
}
-(void)setData:(NSMutableDictionary *)data
{
    if ([TKL_LoginViewModel shareInterface].headImage)
    {
        _leftIV.image=[TKL_LoginViewModel shareInterface].headImage;
    }else
    {
        [_leftIV sd_setImageWithURL:[NSURL URLWithString:[data objectForKey:@"avatar"]] placeholderImage:DefaultAvatarFImage];
    }
    if ([data count]!=0)
    {
        _titleLab.text=[data objectForKey:@"nickname"];
        _phoneLab.text=[data objectForKey:@"telephone"];
    }else
    {
        _titleLab.text=@"点击登录";
        _phoneLab.text=@"";
        _leftIV.image=DefaultAvatarFImage
        ;
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}
#pragma mark - delegate
@end
